package com.example.wlt.personnel_manegement_system.Manager.Person;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import com.example.wlt.personnel_manegement_system.Adapter.MemberstatusAdapter;
import com.example.wlt.personnel_manegement_system.Item.Item_memberstatus;
import com.example.wlt.personnel_manegement_system.R;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by WLT on 2016/5/2.
 */
public class Fragment_memberstatus extends Fragment {

    private ListView lv_item;//成员状态名单
    private SimpleAdapter simp_adapter;
    private List<Map<String,Object>> datalist;//数据源
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.person_memberstatus, container, false);

        lv_item=(ListView)view.findViewById(R.id.lv_memstatus_item);

        //创建数据源
        List<Item_memberstatus> Item=new ArrayList<>();
        for(int i=0;i<20;i++){
            Item.add(new Item_memberstatus
                    (
                            "王二",
                            "男",
                            "运营部",
                            "有",
                            "在"
                    ));
        }
        //加载适配器
        lv_item.setAdapter(new MemberstatusAdapter(this.getActivity().getApplicationContext(),Item));
        return view;
    }
}
